#include <iostream>
#include <string>

#include <omp.h>

int main(int argc,char* argv[])
{
	using namespace std;
	
	cout << "Main thread" << endl;
	
	for (int n = 0; n < 5; ++n)
	{
		cout << "Enter parallel block with " << n << " threads." << endl;

#pragma omp parallel num_threads(n)
		{
			int i = omp_get_thread_num();
		
			cout << "Hello from thread " << i << endl;
		}

		cout << "Done parallel block." << endl;

	}

	cout << "Main thread" << endl;
	
	return 0;
}

